<?php

class McCube_Error{

    protected static $errorMsg  = array(
        //  E_PARSE              => array('color'=> '', 'txt'=> 'Parse Error')
        //, E_CORE_ERROR         => array('color'=> '', 'txt'=> 'Core Error')
        //, E_CORE_WARNING       => array('color'=> '', 'txt'=> 'Core Warning')
        //, E_COMPILE_ERROR      => array('color'=> '', 'txt'=> 'Compile Error')
        //, E_COMPILE_WARNING    => array('color'=> '', 'txt'=> 'Compile Warning')

          E_NOTICE             => array('type'=> 'notice', 'txt'=> 'Notice')
        , E_ERROR              => array('type'=> 'error' , 'txt'=> 'Error')
        , E_WARNING            => array('type'=> 'alert' , 'txt'=> 'Alert')
        , E_USER_ERROR         => array('type'=> 'error' , 'txt'=> 'Specific Error')
        , E_USER_WARNING       => array('type'=> 'alert' , 'txt'=> 'Specific Alert')
        , E_USER_NOTICE        => array('type'=> 'notice', 'txt'=> 'Specific Notice')
        , E_STRICT             => array('type'=> 'notice', 'txt'=> 'Runtime Notice')
        , E_RECOVERABLE_ERROR  => array('type'=> 'error' , 'txt'=> 'Catchable Fatal Error')
    );

    /** */
    public static function handler($errno, $errstr, $errfile, $errline){
        McCube_Notifier::render(
            '[@'.self::$errorMsg[$errno]['type'].'@'
                .self::$errorMsg[$errno]['txt']
            .'@]'
            , $errstr, true
        );
    }

}